package edu.maping.easy.sequence;

import processing.core.PApplet;

public class SequenceRenderer {

	public void render(ArrayListStepper<SequenceStep> actionSequence,
			PApplet pApplet) {

		int x = 190;
		pApplet.fill(255, 0, 0);
		int y = pApplet.height - 25;
		pApplet.text("SEQU3NCE:", x - 180, y);
		y -= 10;

		if (actionSequence == null)
			return;

		pApplet.fill(255, 0, 0);
		for (int index = 0; index < actionSequence.seqs.size(); index++) {
			// Moment moment = seqs.get(i);
			pApplet.ellipse((25 * index) + x, y, 5, 5);
			if (actionSequence.getCurrent() == index) {
				pApplet.noFill();
				pApplet.rect((25 * index) + x + 10, y - 10, (25 * index) + x
						- 10, y + 25);
			}

			if (actionSequence.getCurrentPlayed() == index) {
				pApplet.noFill();
				pApplet.stroke(0, 255, 0);
				pApplet.rect((25 * index) + x + 10, y - 10, (25 * index) + x
						- 10, y + 25);
			}
		}

		if (actionSequence.seqs.isEmpty()) {
			return;
		}
	}
}
